home *** CD-ROM | disk | FTP | other *** search
/ Crosscountry USA Photo Safari / Crosscountry USA Photo Safari.iso / Data / cc_base / pak00_16bit_f.pk3 / map_actor_city.c4 < prev    next >
Text File  |  2003-01-02  |  2KB  |  56 lines

  1. {
  2.     @draw {
  3.       resid font_id;
  4.       resid map_id;
  5.       int x;
  6.       int y;
  7.       str name;
  8.     
  9.       font_id = ResByName("font/verdana_9_black.tf");
  10.       x = ResPropGetInt(SELF, "ScreenX");
  11.       y = ResPropGetInt(SELF, "ScreenY");
  12.       x += ResPropGetInt(SELF, "text_x");
  13.       y += ResPropGetInt(SELF, "text_y");
  14.       name = ResPropGetStr(SELF, "name");
  15.       DrawTextStr(font_id, x, y, "%s", name);
  16.     }
  17.     @mouseenter {
  18.       ResPropSetResID(SELF, "AnimationID", ResPropGetResID(SELF, "selected_dot"));
  19.     }
  20.     @mouseleave {
  21.       ResPropSetResID(SELF, "AnimationID", ResPropGetResID(SELF, "dot"));
  22.     }
  23.     @activate {
  24.       str   cur_city;
  25.       resid Player;
  26.       resid city_data_id;
  27.       resid state_data_id; 
  28.       resid csv_data_id;
  29.       int   map_view_city_row_num;
  30.       int   map_view_state_row_num;
  31.       
  32.       /* get player information */
  33.       Player = ResPropGetResID(ResByName("Game"),"game_cur_player"); 
  34.       
  35.       Release("laptop_new_city");
  36.       Mark("laptop_new_city");
  37.            
  38.       cur_city = ResPropGetStr(SELF, "name");
  39.  
  40.       /* get player view city information */
  41.       csv_data_id = ResByName("CSVData");
  42.       city_data_id = ResPropGetResID(csv_data_id, "city_id"); 
  43.       state_data_id = ResPropGetResID(csv_data_id, "state_id");
  44.       
  45.       map_view_city_row_num = CSVSearch(city_data_id, "name", cur_city);
  46.       ResPropSetInt(Player, "map_view_city_row_num", map_view_city_row_num);
  47.       ResPropSetStr(Player, "map_view_city", cur_city);
  48.       
  49.       map_view_state_row_num = CSVSearch(state_data_id, "abbreviation", CSVGetStr(city_data_id, "state", map_view_city_row_num));
  50.       ResPropSetInt(Player, "map_view_state_row_num", map_view_state_row_num);
  51.       ResPropSetStr(Player, "map_view_state", CSVGetStr(state_data_id, "name", map_view_state_row_num));
  52.  
  53.       ResParseEvent(ResByName("map.gl"), "@updateCityStateViews");
  54.     }
  55. }
  56.